/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.ieslaferreria.creditsintesis.rmi;

import edu.ieslaferreria.creditsintesis.logicgame.actions.RmiEvent;
import java.rmi.RemoteException;

/**
 * Clase que crea puentes
 * @author Rubén
 */
public class PontImpl extends java.rmi.server.UnicastRemoteObject implements Pont {
    String name;
    EventRemoteListener  listener;
    boolean Interacction = false;
    
    /** Constructs PontImpl object and exports it on default port.
     */
    public PontImpl(EventRemoteListener  li,String name) throws RemoteException {
        super();
        this.listener = li;
        this.name=name;
    }

    public void send(RmiEvent Mis) throws RemoteException {
        this.listener.action(Mis);
    }

    public void setListener(EventRemoteListener  listener) throws RemoteException {
        this.listener = listener;
    }

    public boolean equals(Pont pont) throws RemoteException{
        return this.name.equals(pont.getPontName());

    }

    public String getPontName() throws RemoteException{
        return this.name;
    }

    public void setPontName(String pontName) throws RemoteException {
        this.name=pontName;
    }

}
